﻿<local:DocumentBase x:Class="WPFExcelReport.JLTAB50LS"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls" 
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"                     
                    FontSize="16"
                    Loaded="Window_Loaded" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="105">
    <local:DocumentBase.Resources>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:DateYR x:Key="yr"/>
        <ucd:DateNYR x:Key="nyr"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </local:DocumentBase.Resources>
    <Grid>
         
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="200"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" >
            <WrapPanel>
                <Label Content="单类："    Width="54" Margin="5,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                <TextBox Name="txtTYPE" Width="28" Margin="5,0,0,0"  HorizontalAlignment="Left" Background="WhiteSmoke" Panel.ZIndex="1"
                         Text="LS" KeyUp="txtART_KeyUp" CharacterCasing="Upper" MaxLength="2" FontSize="18" Foreground="#FF141111" Height="33" />
                <Label Content="任务书："    Width="70" Margin="5,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                <TextBox Name="txtCO" Width="152" Margin="0,0,0,0"  HorizontalAlignment="Left" Background="Pink" Panel.ZIndex="2"
                         KeyUp="txtART_KeyUp" CharacterCasing="Upper" MaxLength="20" FontSize="18" Foreground="#FF141111" Height="33" />
                <Label Content="纱线编号："    Width="87" Margin="5,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                <TextBox Name="txtARTICLE" Width="175" Margin="0,0,0,0"  HorizontalAlignment="Left" Background="Pink" Panel.ZIndex="3"
                         KeyUp="txtART_KeyUp" CharacterCasing="Upper" MaxLength="20" FontSize="18" Foreground="#FF141111" Height="33" />

                <Label Content=""    Width="29" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                <CheckBox IsChecked="False" Background="White" Name="Chk" Height="19" Width="134">显示已留位完成</CheckBox>
                <Button Content="查询" Height="33" Margin="10,0,0,0"  Name="btnQuery" Width="96" Panel.ZIndex="6"
                        Click="btnQuery_Click"/>
                <Button Content="导出" Height="33" Margin="10,0,0,0"  Name="btnEXCEL" Width="100" Panel.ZIndex="7"
                        Click="btnEXCEL_Click"/>
            </WrapPanel>
        </StackPanel>
        <DataGrid Grid.Row="1" Margin="0,1,0,0"    
                  FontSize="12"
                              CanUserReorderColumns="True"  
                              CanUserResizeRows="True" CanUserSortColumns="True"                  
                              AutoGenerateColumns="False"   
                              EnableRowVirtualization="True"  SelectionChanged="MasterDg_SelectionChanged"
                              RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                              IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                              ItemsSource="{Binding}" x:Name="MasterDg" >
            <DataGrid.Columns>
                <!--CO	ABPAUFKRS	ABPAUFLFD	ABPAUFPOS	ABPART	ARTDESC	ABPFARBE	
                COLOR	ORDQTY	ALLOQTY	ABPNEUDAT	ABPNEUBEN	STATUS -->
                <DataGridTextColumn Header="任务书" Binding="{Binding CO}" Width="Auto"/>
                <DataGridTextColumn Header="纱线编号" Binding="{Binding ABPART}" Width="Auto"/>
                <DataGridTextColumn Header="纱名" Binding="{Binding ARTDESC}" Width="Auto"/>
                <DataGridTextColumn Header="色号" Binding="{Binding ABPFARBE}" Width="Auto"/>
                <DataGridTextColumn Header="色名" Binding="{Binding COLOR}" Width="Auto"/>
                <DataGridTextColumn Header="订单量" Binding="{Binding ORDQTY}" Width="Auto"/>
                <DataGridTextColumn Header="订单留位量" Binding="{Binding ALLOQTY}" Width="Auto"/>
                <DataGridTextColumn Header="订单发纱量" Binding="{Binding ISSUEQTY}" Width="Auto"/>
                <DataGridTextColumn Header="状态" Binding="{Binding STATUS}" Width="Auto"/>
                <DataGridTextColumn Header="纺批" Binding="{Binding SPPART}" Width="Auto"/>
                <DataGridTextColumn Header="纺坯留位量" Binding="{Binding ZUEINTKG}" Width="Auto"/>
                <DataGridTextColumn Header="纺坯发纱量" Binding="{Binding ZUENTNKG}" Width="Auto"/>
                <DataGridTextColumn Header="供应商" Binding="{Binding LSNAME2,Converter={StaticResource ResourceKey=gb2312}}" Width="Auto"/>
                <DataGridTextColumn Header="开单日期" Binding="{Binding ABPNEUDAT,Converter={StaticResource yr}}" Width="Auto"/>
                <DataGridTextColumn Header="开单人" Binding="{Binding ABPNEUBEN}" Width="Auto"/>
                <DataGridTextColumn Header="前缀" Binding="{Binding ABPAUFKRS}" Width="Auto"/>
                <DataGridTextColumn Header="单号" Binding="{Binding ABPAUFLFD}" Width="Auto"/>
                <DataGridTextColumn Header="行号" Binding="{Binding ABPAUFPOS}" Width="Auto"/>
            </DataGrid.Columns>
        </DataGrid  >
        <DataGrid Grid.Row="2" Margin="0,1,0,0" 
                              FontSize="12"
                              CanUserReorderColumns="True"  
                              CanUserResizeRows="True" CanUserSortColumns="True"                  
                              AutoGenerateColumns="False"   
                              EnableRowVirtualization="True"  
                              RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                              IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                              ItemsSource="{Binding}" x:Name="dlDg"  
                              >
            <DataGrid.Columns>
                <!--TYP	BAGART	BAGFARBE	BAGGART	BAGGFARBE	BAGBEM-->
                <DataGridTextColumn Header="类型" Binding="{Binding TYP}" Width="Auto"/>
                <DataGridTextColumn Header="任务书" Binding="{Binding BAGART}" Width="Auto"/>
                <DataGridTextColumn Header="花型号" Binding="{Binding BAGFARBE}" Width="Auto"/>
                <DataGridTextColumn Header="纱线编号" Binding="{Binding BAGGART}" Width="Auto"/>
                <DataGridTextColumn Header="色号" Binding="{Binding BAGGFARBE}" Width="Auto"/>
                <DataGridTextColumn Header="色名" Binding="{Binding BAGBEM}" Width="Auto"/>
            </DataGrid.Columns>
        </DataGrid  >
    </Grid>
</local:DocumentBase>
